package com.jh.paymentchannel.pojo.enums;

public enum CmRefundStatus {
    NO_REFUND(0, "未退款"),
    REFUND_ING(1, "退款中"),
    REFUND_SUCCESS(2, "退款成功")
    ;
    private short value;
    private String desc;

    CmRefundStatus(int value, String desc) {
        this.value = (short) value;
        this.desc = desc;
    }
    public short getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static <T extends Number> CmRefundStatus of(T n) {
        short val;
        if (null == n || (val = n.shortValue()) < 0) {
            return null;
        }

        for (CmRefundStatus refundStatus : values()) {
            if (refundStatus.getValue() == val) {
                return refundStatus;
            }
        }
        return null;
    }
}
